<template>
	<view class="orderInformation_container">
		<view class="" style="height: 160rpx;">
		<view class="mail_List fixed z_ninetynine">
			<view class="mail" style="font-weight: 700;">
				<view class="order">工单信息</view>
			</view>
		</view>
		<view class="icon fixed z_ninetynine">
			<u-icon name="arrow-left" color="#fefefe" size="40" @click="navigateBack"></u-icon>
		</view>
			
		</view>
		<!-- 报事人信息 -->
		<view class="data_Statistics" style="padding: 44rpx 24rpx 0 ;">
			<text style="font-weight: 700; font-size: 30rpx; color: #c4c4c4;">丨</text><text
				style="font-weight: 700; font-size: 30rpx;">报事人信息</text>
		</view>
		<view class="card" style="padding: 0 42rpx;">
			<u-form :model="form" ref="uForm">
				<u-form-item label="报事人:">
					<u-input v-model="form.Reporter"
						placeholder-style="color: #000; text-align: right; font-weight: 600;" :placeholder="particulars.reportPerson"
						:clearable="false" :disabled="true" />
				</u-form-item>
				<u-form-item label="联系方式:">
					<view class="" style="display: flex;justify-content: flex-end;">
						<u-input v-model="form.address"
							placeholder-style="color: #000; text-align: right; font-weight: 600;" :placeholder="particulars.phoneNumber"
							:clearable="false" :disabled="true" />
							<u-rate :count="count" :min-count="1" v-model="value" @change="change"></u-rate>
					</view>
				</u-form-item>
			</u-form>
		</view>
		<!-- 报事详情 -->
		<view class="data_Statistics" style="padding: 28rpx 24rpx 0 ;">
			<text style="font-weight: 700; font-size: 30rpx; color: #c4c4c4;">丨</text><text
				style="font-weight: 700; font-size: 30rpx;">报事详情</text>
		</view>
		<view class="card" style="padding: 0 42rpx;">
			<u-form :model="form" ref="uForm">
				<u-form-item label="标题:">
					<u-input v-model="form.Reporter"
						placeholder-style="color: #000; text-align: right; font-weight: 600;" :placeholder="particulars.describe"
						:clearable="false" :disabled="true" />
				</u-form-item>
				<u-form-item label="类型:">
					<u-input v-model="form.address"
						placeholder-style="color: #000; text-align: right; font-weight: 600;" placeholder="建议"
						:clearable="false" :disabled="true" />
				</u-form-item>
				<u-form-item label="报事时间:">
					<u-input v-model="form.address"
						placeholder-style="color: #000; text-align: right; font-weight: 600;"
						placeholder="2021-06-09 12: 23: 32" :clearable="false" :disabled="true" />
				</u-form-item>
				<u-form-item label="事件地址:">
					<u-input v-model="form.address"
						placeholder-style="color: #000; text-align: right; font-weight: 600;" :placeholder="particulars.addressCommunity"
						:clearable="false" :disabled="true" />
				</u-form-item>
				<u-form-item label="事件描述:" label-position="top">
					<u-input v-model="form.describe" type="textarea"
						placeholder-style="color: #000; text-align: right; font-weight: 600;"
						:placeholder="particulars.describe" :clearable="false" :disabled="true" />
				</u-form-item>
				
				<u-form-item v-show="images.length!=0">
					<view style="display: flex; flex-wrap: wrap;">
						<view style="width:210rpx; height: 316rpx;margin-right: 10rpx;margin-bottom: 10rpx; background-color: #f2f2f2;" v-for="(item,index) in images">
							<image :src="item.imgUrl" mode="" style="width: 100%;height: 100%;"></image>
						</view>
					</view>
				</u-form-item>
				
			</u-form>
		</view>
		<!-- 工单分配 -->
		<view class="order_Allocation">
			<view class="data_Statistics" style="padding: 28rpx 24rpx 0 ;">
				<text style="font-weight: 700; font-size: 30rpx; color: #c4c4c4;">丨</text><text
					style="font-weight: 700; font-size: 30rpx;">工单分配</text>
			</view>
			<view class="card" style="position: relative; padding: 0 42rpx;">
				<u-form :model="form" ref="uForm">
					<u-form-item label="选择负责人:">
						<u-input v-model="form.Reporter"
							placeholder-style="color: #000; text-align: right; font-weight: 600;" placeholder="刘备"
							:clearable="false" :disabled="true" />
					</u-form-item>
					<u-form-item label="选择执行人:">
						<u-input v-model="form.address"
							placeholder-style="color: #000; text-align: right; font-weight: 600;" placeholder="黄忠、马超"
							:clearable="false" :disabled="true" />
					</u-form-item>
<!-- 					<u-form-item label="维保时间:">
						<u-input v-model="form.address"
							placeholder-style="color: #000; text-align: right; font-weight: 600;"
							placeholder="2021-06-09 12: 23: 32" :clearable="false" :disabled="true" />
					</u-form-item>
					<u-form-item label="结束时间:">
						<u-input v-model="form.address"
							placeholder-style="color: #000; text-align: right; font-weight: 600;"
							placeholder="2021-06-09 24: 23: 32" :clearable="false" :disabled="true" />
					</u-form-item> -->
					<u-form-item label="执行状态:">
						<u-input v-model="form.address"
							placeholder-style="color: #000; text-align: right; font-weight: 600;" placeholder="已完成"
							:clearable="false" :disabled="true" />
					</u-form-item>
					<image src="/static/workOrder/Group803.png" mode="" style=" position: absolute;top: 94rpx; left: 236rpx; width: 280rpx; height: 280rpx;">
					</image>
				</u-form>
			</view>
		</view>
		<!-- 执行信息 -->
		<view class="data_Statistics" style="padding: 28rpx 24rpx 0 ;">
			<text style="font-weight: 700; font-size: 30rpx; color: #c4c4c4;">丨</text><text
				style="font-weight: 700; font-size: 30rpx;">执行信息</text>
		</view>
		<view class="card" style="padding: 0 42rpx;">
			<u-form :model="form" ref="uForm">
				<u-form-item label="执行结束时间:">
					<u-input v-model="form.address"
						placeholder-style="color: #000; text-align: right; font-weight: 600;" :placeholder="particulars.staffTime"
						:clearable="false" :disabled="true" />
				</u-form-item>
				<u-form-item label="执行过程描述:" label-position="top">
					<u-input v-model="form.describe" type="textarea"
						placeholder-style="color: #000; text-align: right; font-weight: 600;"
						:placeholder="particulars.executeMethod" :clearable="false" :disabled="true" />
				</u-form-item>
				<u-form-item v-show="imagesVos.length!=0">
					<view style="display: flex; flex-wrap: wrap;">
						<view style="width:210rpx; height: 316rpx;margin-right: 10rpx;margin-bottom: 10rpx; background-color: #f2f2f2;" v-for="(item,index) in imagesVos">
							<image :src="item.imgUrl" mode="" style="width: 100%;height: 100%;"></image>
						</view>
					</view>
				</u-form-item>
			</u-form>
		</view>
		<view class="button">
			<u-button type="primary" style="flex: 1;" @click="resolved">返工</u-button>
			<u-button type="success" style="flex: 1;" @click="Approved">复查审核</u-button>
		</view>
		<u-popup v-model="show" mode="center" width="626rpx" height="430rpx" border-radius="20">
			<view
				style="height: 54rpx; line-height: 54rpx; font-weight: 600; color: #a1a1a1; background-color: #fbfbfb; text-align: center;">
				工单提示</view>
			<view class="work_Order">
				<view class="work_Order_top"></view>
				<view class="work_Order_bottom" style="margin-top: 10rpx;">催促工单成功！</view>
			</view>
		</u-popup>
		<u-popup v-model="show2" mode="center" width="626rpx" height="430rpx" border-radius="20">
			<view
				style="height: 54rpx; line-height: 54rpx; font-weight: 600; color: #a1a1a1; background-color: #fbfbfb; text-align: center;">
				复查审核</view>
			<view class="work_Order">
				<view class="work_Order_top"></view>
				<view class="work_Order_bottom" style="margin-top: 10rpx;">确认完成！</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				// form表单
				form: {
					Reporter: '',
					title: '',
					address: '',
					describe: '',
					chargePerson: '',
					Executor: '',
					Maintenance: '',
					end: ''
				},
				// 演示地址，请勿直接使用
				action: 'http://www.example.com/upload',
				show: false,
				show2:false,
				// 待复查Id
				orderId:'',
				// 车辆详情
				particulars:'',
				images:'',
				imagesVos:'',
				// 审核通过
				staff:'',
				count: 1,
				value: 0,
				userPhone:'',
				userName:''
			}
		},
		onLoad(val) {
			this.loginId = uni.getStorageSync("setModel")
			if(val.orderId){
			this.orderId=val.orderId
				// 待复查详情
				this.getListVehicleByIds()
			}
			// this.loading()
		},
		methods: {
			// 收藏电话号码
			change(e) {
				console.log(e)
				this.$http.post('Collect/insertOwnerTenant',{userPhone:this.userPhone,userId:this.loginId.userId,userName:this.userName}).then(res => {
					console.log(res,'收藏电话号码')
					// this.particulars=res.data
				})
			},
			// 待复查详情
			getListVehicleByIds() {
				this.$http.get('WorkOrder/getReportOrderTobeReviewedDetails',{orderId:this.orderId,loginId:this.loginId.userId}).then(res => {
					this.particulars=res.data
					this.images=res.data.images
					this.imagesVos=res.data.imagesVos
					this.userPhone = res.data.phoneNumber
					this.userName = res.data.reportPerson
					// console.log(res, '待审核')
					// this.owners = res.data
				})
			},
			resolved() {
				this.show = true
			},
			Approved() {
				this.show2 = true
				// console.log(171)
				// 复查通过
				this.$http.put('WorkOrder/updateReportOrderReviewed',{id:this.orderId}).then(res => {
					// this.particulars=res.data
					// console.log(res, '复查通过')
					// this.owners = res.data
				})
				setTimeout(function() {
					uni.navigateBack()
				}, 1000);
			}
		}
	}
</script>

<style lang="scss" scoped>
	.orderInformation_container {
		.mail_List {
			overflow: hidden;
			width: 100%;
			background-color: #f2f2f2;

			.mail {
				padding: 10rpx 0;
				// margin-top: 96rpx;
				color: #999999;
				font-size: 40rpx;
				background-color: #e5e5e5;
			}

			.order {
				text-align: center;
			}
		}

		/deep/.card {
			.u-form-item--left {
				flex: unset !important;
				width: unset !important;
			}
		}

		.icon {
			position: absolute;
			top: 18rpx;
			// top: 114rpx;
			left: 20rpx;
		}

		.second_card {
			.u-cell {
				padding: 18rpx 32rpx;

				/deep/.u-cell__value {
					color: #333333;
					font-weight: 600;
				}
			}

			/deep/.uni-card__content {
				padding: 16rpx 24rpx;
			}
		}

		/deep/button {
			border-radius: unset !important;
		}

		.uni-border[data-v-19622063]:after {
			border: unset;
		}

		/deep/.uni-border.data-v-19622063:after {
			border: unset;
		}

		.slot-btn__hover {
			background-color: rgb(235, 236, 238);
		}

		.button {
			display: flex;
			// position: fixed;
			// left: 0;
			// right: 0;
			// bottom: 0;
			margin-top: 200rpx;
			border-radius: 14rpx;
			overflow: hidden;
			z-index: 9;

			.u-btn {
				border-radius: unset;
			}
		}

		.work_Order {
			margin-top: 60rpx;
			text-align: center;

			.work_Order_top {
				width: 168rpx;
				height: 168rpx;
				margin: 0 auto;
				background-color: #e5e5e5;
				border-radius: 50%;
			}
		}
	}
</style>
